Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add namespace loader #320

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

alexander-schranz
Copy link

This introduce a namespace loader. This allows to use a namespace like app:: similar to Plates and Blade template engine.

Usage:

    $defaultLoader = new FileLoader(__DIR__ . '/templates');
    $emailLoader = new FileLoader(__DIR__ . '/emails');
    $someLoader = new FileLoader(__DIR__ . '/vendor/some/some/templates');
    $otherLoader = new StringLoader(['main' => 'othercontent']);

    $loader = new NamespaceLoader([
        '' => $defaultLoader,
        'email' => $emailLoader,
        'some' => $someLoader,
        'other' => $otherLoader,
    ]);

This way it is very flexible as we can use any loader again.

@alexander-schranz alexander-schranz force-pushed the feature/namespace-loader branch 2 times, most recently from 91639ac to d8ea450 Compare November 1, 2022 15:57
@alexander-schranz alexander-schranz changed the title Feature/namespace loader Add namespace loader Nov 1, 2022
@alexander-schranz
Copy link
Author

alexander-schranz commented Nov 5, 2022

@dg looks like you rebased it. Do I need to change the target branch?

Edit: Oh my fault looks like the master was force pushed to another state. I will rebase my branch.

@dg dg force-pushed the master branch 8 times, most recently from 8d92896 to 1267554 Compare May 27, 2024 11:56
@dg dg force-pushed the master branch 4 times, most recently from ee646d6 to b80c3a6 Compare June 18, 2024 21:40
@Crell
Copy link

Crell commented Jul 19, 2024

It looks like @dg has been rebasing this diligently for 2 years. I am also very interested in this feature (the thing I'm trying to do right now likely won't really work without it), as currently there seems to be no way to reference a layout that is not in the same directory as the template, or else have relative paths defined in the {layout} block (ew).

Is there something we users could do to help move this forward, or get attention on it?

@dg dg force-pushed the master branch 10 times, most recently from 6c48587 to bd46751 Compare August 9, 2024 02:30
@dg dg force-pushed the master branch 7 times, most recently from 6baf2c5 to 4db7a55 Compare October 8, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants